<div ng-controller="regController" class="container wrap-form">
    <div class="row">
        <div class="col-xs-5 col-thin right">
            <a href="#" class="logo"></a>
        </div>
        <div class="col-xs-6 col-header">
            <h4>我要注册</h4>
            <p>已有账号？请<a href="<{:U('Login/index')}>">&nbsp;登录</a></p>
        </div>
    </div>

    <form name="regForm" class="form-horizontal" role="form" novalidate ng-submit="submit()">
        <div class="form-group">
            <label for="inputPhone" class="col-xs-3 control-label sm-label label-phone">手机</label>
            <div class="col-xs-9"
                 ng-class="{'has-success has-feedback': regForm.phone.$valid, 'has-error has-feedback': regForm.phone.$invalid && regForm.phone.$dirty}">
                <input type="tel" name="phone" class="form-control" id="inputPhone" placeholder="手机号将作为登陆账号"
                       required reg-phone="form.phone" ng-model="form.phone">
                <span ng-show="regForm.phone.$valid" class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span ng-show="regForm.phone.$invalid && regForm.phone.$dirty" class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span>
                <div class="warning"
                     ng-show="regForm.phone.$invalid && regForm.phone.$dirty">
                    <span
                           ng-show="regForm.phone.$error.required">
                        手机号不能为空
                    </span>
                    <span
                           ng-show="regForm.phone.$error.regphone && !regForm.phone.$error.required">
                        手机号不符合格式
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-5">
                <button class="btn btn-default btn-code" ng-click="getVerifyCode()" ng-disabled="timerIsShow">获取手机验证码<span ng-show="timerIsShow">{{ timer }}</span></button>
            </div>
            <div class="col-xs-4 warning">
                <span>
                    {{ codeMsg }}
                </span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9"
                    ng-class="{'has-success has-feedback': regForm.verifyCode.$valid, 'has-error has-feedback': regForm.verifyCode.$invalid && regForm.verifyCode.$dirty}">
                <input type="tel" name="verifyCode" class="form-control" id="inputValidate" placeholder="手机验证码"
                       required ng-model="form.verifyCode">
                <span ng-show="regForm.verifyCode.$valid" class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span ng-show="regForm.verifyCode.$invalid && regForm.verifyCode.$dirty" class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span>
                <div class="warning"
                     ng-show="regForm.verifyCode.$invalid && regForm.verifyCode.$dirty">
                    <span
                           ng-show="regForm.verifyCode.$error.required">
                        请输入验证码
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword" class="col-xs-3 control-label sm-label label-psw">密码</label>
            <div class="col-xs-9"
                 ng-class="{'has-success has-feedback': regForm.psw.$valid, 'has-error has-feedback': regForm.psw.$invalid && regForm.psw.$dirty}">
                <input type="password" name="psw" class="form-control" id="inputPassword" placeholder="6-18位密码"
                       required reg-psw="form.psw" psw-repeat ng-model="form.psw">
                <span ng-show="regForm.psw.$valid" class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span ng-show="regForm.psw.$invalid && regForm.psw.$dirty" class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span>
                <div class="warning"
                     ng-show="regForm.psw.$invalid && regForm.psw.$dirty">
                    <span
                           ng-show="regForm.psw.$error.required">
                        密码不能为空
                    </span>
                    <span
                           ng-show="regForm.psw.$error.regpsw && !regForm.psw.$error.required">
                        密码需为6-18位
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword" class="col-xs-3 control-label sm-label label-psw">重复密码</label>
            <div class="col-xs-9" ng-class="{'has-success has-feedback': regForm.pswRepeat.$valid, 'has-error has-feedback': regForm.pswRepeat.$invalid && regForm.pswRepeat.$dirty}">
                <input type="password" name="pswRepeat" class="form-control" id="inputPassword2" required psw-repeat ng-model="form.pswRepeat" placeholder="再次输入密码">
                <span ng-show="regForm.pswRepeat.$valid" class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <div class="warning"
                     ng-show="regForm.pswRepeat.$invalid && regForm.pswRepeat.$dirty">
                    <span
                           ng-show="regForm.pswRepeat.$error.repeat && !regForm.pswRepeat.$error.required">
                        两次密码输入不一致
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="inputName" class="col-xs-3 control-label sm-label label-name">真实姓名</label>
            <div class="col-xs-9">
                <input type="text" name="userName" class="form-control" id="inputName" ng-model="form.userName" placeholder="建议填写真实姓名，增加可信度">
            </div>
        </div>
        <div class="form-group form-group-sex">
            <label for="radioSex1" class="col-xs-3 control-label sm-label label-sex">性别</label>
            <div class="col-xs-9" ng-init="form.sex = 1">
                <label class="radio-inline">
                    <input type="radio" name="sex" id="radioSex1" value="1" ng-model="form.sex">男
                </label>
                <label class="radio-inline">
                    <input type="radio" name="sex" id="radioSex2" value="2" ng-model="form.sex">女
                </label>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="isAgree" ng-init="form.isAgree = true" ng-model="form.isAgree" required>同意<a href="<{:U('Register/protocol')}>">《用户注册协议》</a>
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12 col-thin center">
                <button type="submit" class="btn btn-default btn-main" ng-disabled="regForm.$invalid">注册</button>
            </div>
        </div>
    </form>
</div>